package edu.hgnc.populateBean;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.*;

public class Person {

	private static final Log logger = LogFactory.getLog(Person.class);


	private int id;
	private String name = "小布丁";
	private int age;
	private String gender;
	private Address address;
	private  String[] hobbies;
	private List<Book> books;
	private Set<Integer> sets;
	private Map<String,Object> maps;
	private Properties properties;





	public Person(int id, String name, int age, String gender) {
		this.id = id;
		this.name = name;
		this.age = age;
		this.gender = gender;

		logger.debug("有参构造器1");
	}

	public Person(int id, String name, String gender) {
		this.id = id;
		this.name = name;
		this.gender = gender;

		logger.debug("有参构造器2");
	}

	public Person(int id, String name, int age) {
		this.id = id;
		this.name = name;
		this.age = age;

		logger.debug("有参构造器3");
	}

	public Person() {
		logger.debug("无参构造器0");
	}

	@PostConstruct
	public void init(){
		logger.debug("init-method-------person");
	}

	@PreDestroy
	public void destroy(){
		logger.debug("destroy----person");
	}

	@Override
	public String toString() {
		return "Person{" +
				"id=" + id +
				", name='" + name + '\'' +
				", age=" + age +
				", gender='" + gender + '\'' +
				", address=" + address +
				", hobbies=" + Arrays.toString(hobbies) +
				", books=" + books +
				", sets=" + sets +
				", maps=" + maps +
				", properties=" + properties +
				'}';
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public String[] getHobbies() {
		return hobbies;
	}

	public void setHobbies(String[] hobbies) {
		this.hobbies = hobbies;
	}

	public List<Book> getBooks() {
		return books;
	}

	public void setBooks(List<Book> books) {
		this.books = books;
	}

	public Set<Integer> getSets() {
		return sets;
	}

	public void setSets(Set<Integer> sets) {
		this.sets = sets;
	}

	public Map<String, Object> getMaps() {
		return maps;
	}

	public void setMaps(Map<String, Object> maps) {
		this.maps = maps;
	}

	public Properties getProperties() {
		return properties;
	}

	public void setProperties(Properties properties) {
		this.properties = properties;
	}
}
